<template>
  <div>
    <clist></clist>
  </div>
</template>

<script>
// import table from "../../components/clients/table";
import clist from "./list";
export default {
  components: {
    // table,
    clist,
  },
  data() {
    return {
      svalue: "",
      form: {
        code: "",
        key: "",
      },
      dialogFormVisible: false,
      tableData: [
        {
          code: 1068,
          name: "广州气站",
          address: "上海市普陀区金沙江路 1518 弄",
          phone: "",
          contact: "",
        },
        {
          code: 1063,
          name: "深圳智物联",
          address: "上海市普陀区金沙江路 1517 弄",
          phone: "",
          contact: "",
        },
        {
          code: 1035,
          name: "深圳一号气站",
          address: "上海市普陀区金沙江路 1519 弄",
          phone: "",
          contact: "",
        },
        {
          code: 1036,
          name: "深圳二号气站",
          address: "上海市普陀区金沙江路 1516 弄",
          phone: "",
          contact: "",
        },
        {
          code: 1040,
          name: "深圳七号气站",
          address: "上海市普陀区金沙江路 1516 弄",
          phone: "",
          contact: "",
        },
        {
          code: 1045,
          name: "广州一号气站",
          address: "上海市普陀区金沙江路 1516 弄",
          phone: "",
          contact: "",
        },
        {
          code: 1046,
          name: "东莞二号气站",
          address: "上海市普陀区金沙江路 1516 弄",
          phone: "",
          contact: "",
        },
        {
          code: 1047,
          name: "惠州一号号气站",
          address: "上海市普陀区金沙江路 1516 弄",
          phone: "",
          contact: "",
        },
      ],
      multipleSelection: [],
    };
  },
  methods: {
    resetNameFilter() {
      this.$refs.filterTable.clearFilter("name");
    },
    clearFilter() {
      this.$refs.filterTable.clearFilter();
    },
    formatter(row, column) {
      return row.address;
    },
    filterTag(value, row) {
      return row.tag === value;
    },
    filterHandler(value, row, column) {
      const property = column["property"];
      return row[property] === value;
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    deleteRow(index, rows) {
      rows.splice(index, 1);
      this.tableData.splice(index, 1);
    },
    deleteRows() {
      for (let i of this.multipleSelection) {
        for (let j in this.tableData) {
          if (i.code == this.tableData[j].code) {
            this.tableData.splice(j, 1);
          }
        }
      }
    },
    getFilters(key) {
      let arr = [];
      for (let i of this.tableData) {
        arr.push({
          text: i[key],
          value: i[key],
        });
      }
      return arr;
    },
    handleRowClick(row, column, event) {
      // console.log(row,column)
      this.$router.push({
        path: "/clients/details",
        // name: 'mallList',
        query: {
          code: row.code,
        },
      });
    },
  },
};
</script>

<style>
</style>